import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 高生平
 * Date: 2025-09-02
 * Time: 21:00
 */
public class Test {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String password = "202592";
        int count = 3;
        while (count != 0) {
            System.out.println("请输入你的密码，你还有" + count + "次机会");
            String input = scanner.nextLine();
            if(input.equals(password)) {
                System.out.println("登录成功");
                break;
            } else {
                count--;
                System.out.println("密码错误！！！");
                if (count == 0) {
                    System.out.println("已无登录机会，登陆失败");
                }
            }
        }
    }
}
